home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / OpenGL-ftn / fglintro.z / fglintro
Encoding:
Text File  |  2001-04-17  |  4.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ffffggggllllIIIInnnnttttrrrroooo((((3333GGGG))))                   OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                   ffffggggllllIIIInnnnttttrrrroooo((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ---- IIIInnnnttttrrrroooodddduuuuccccttttiiiioooonnnn ttttoooo OOOOppppeeeennnnGGGGLLLL FFFFOOOORRRRTTTTRRRRAAAANNNN BBBBiiiinnnnddddiiiinnnnggggssss
  10.  
  11.  
  12.  
  13. OOOOVVVVEEEERRRRVVVVIIIIEEEEWWWW
  14.      OpenGL is a high-performance 3D-oriented renderer that supersedes IrisGL.
  15.      It is supported on all SGI graphics adaptors except for the G, GT and
  16.      GTX. A number of other workstation and personal computer vendors also
  17.      support OpenGL.
  18.  
  19.      This manpage contains OpenGL FORTRAN binding specific information.
  20.  
  21.  
  22. NNNNOOOOTTTTEEEESSSS
  23.      The FORTRAN bindings naming convention for routines is to prefix each
  24.      OpenGL call with fgl. GL_ prefix is used for the constants.
  25.  
  26.      The OpenGL FORTRAN bindings header files consist of /usr/include/GL/fgl.h
  27.      and /usr/include/GL/fglu.h, the OpenGL FORTRAN bindings libraries are
  28.      /usr/lib/libfGL.a and /usr/lib/libfGLU.a.
  29.  
  30.      There are no FORTRAN bindings for X and GLX.
  31.  
  32.      To determine if a pointer is null, compare it to GL_NULL (which is
  33.      actually an 8-character string).
  34.  
  35.      Beware of problems with the commands that return strings of potentially
  36.      unlimited length, such as ffffggggllllGGGGeeeettttSSSSttttrrrriiiinnnngggg. The FORTRAN bindings support only
  37.      limited length strings. If you need to deal with longer strings, you will
  38.      need to write an interface routine that copies the result string into a
  39.      buffer and then returns a token at a time.
  40.  
  41.  
  42. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  43.      Compile with f77 -o sphere sphere.f -lfglut -lfGLU -lfGL -lglut -lGLU
  44.      -lGL -lXmu -lXext -lXi -lX11
  45.  
  46.      C  GLUT Fortran program to draw red light sphere.
  47.  
  48.              subroutine display #include "GL/fgl.h"
  49.              call fglclear(GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT)
  50.              call fglcalllist(1)
  51.              call glutswapbuffers
  52.              end
  53.  
  54.              subroutine gfxinit #include "GL/fgl.h"
  55.              real diffuse(4),pos(4)
  56.              data diffuse /1.0, 0.0, 0.0, 1.0/
  57.              data pos /1.0, 1.0, 1.0, 0.0/
  58.              call fglnewlist(1, GL_COMPILE)
  59.              call glutsolidsphere(dble(1.0), 20, 20)
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ffffggggllllIIIInnnnttttrrrroooo((((3333GGGG))))                   OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                   ffffggggllllIIIInnnnttttrrrroooo((((3333GGGG))))
  71.  
  72.  
  73.  
  74.              call fglendlist
  75.              call fgllightfv(GL_LIGHT0, GL_DIFFUSE, diffuse)
  76.              call fgllightfv(GL_LIGHT0, GL_POSITION, pos)
  77.              call fglenable(GL_LIGHTING)
  78.              call fglenable(GL_LIGHT0)
  79.              call fglenable(GL_DEPTH_TEST)
  80.              call fglmatrixmode(GL_PROJECTION)
  81.              call fgluperspective(dble(40.0), dble(1.0),
  82.           2                       dble(1.0), dble(10.0))
  83.              call fglmatrixmode(GL_MODELVIEW)
  84.              call fglulookat(dble(0.0), dble(0.0), dble(5.0),
  85.           2                  dble(0.0), dble(0.0), dble(0.0),
  86.           3                  dble(0.0), dble(1.0), dble(1.0))
  87.              call fgltranslatef(0.0, 0.0, -1.0)
  88.              end
  89.  
  90.              program main #include "GL/fglut.h"
  91.              external display
  92.              external reshape
  93.              external submenu
  94.              external mainmenu
  95.              call glutinit
  96.              call glutinitdisplaymode(GLUT_DOUBLE+GLUT_RGB+GLUT_DEPTH)
  97.              call glutcreatewindow('Fortran GLUT sphere')
  98.              call gfxinit
  99.              call glutdisplayfunc(display)
  100.              call glutmainloop
  101.              end
  102.  
  103.  
  104. BBBBUUUUGGGGSSSS
  105.      OpenGL FORTRAN bindings may contain unresolved symbols. Adding
  106.      -ignore_unresolved to your compile command line will eliminate the error.
  107.  
  108.  
  109. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  110.      ggggllllIIIInnnnttttrrrroooo
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.